﻿/*
Mouse SKIN.
Utils of MouseBase;
*/
package com.cf.core.model{
	import flash.display.Shape;
	import flash.display.MovieClip;
	import com.cf.core.model.SmartClipEX;
	public class MouseSkin extends SmartClipEX{
		private var G_normal:Boolean=false;
		// public function MouseSkin():void{}//fn
		override public function init():void{
			G_normal=Boolean( findLabel("normal") || findLabel("up") );
			if( !G_normal ){
				defaultSkin();
			}else{
				// Lib object detected, attach on Cursor.
			}//if
		}//fn
		
		public function ani(_fr:String,_loop:Boolean=false):void{
			if( findLabel(_fr) )
			if( _loop ){
				this.playLoop(_fr,true);
			}else{
				if( findLabel("normal") ) this.playOrder([_fr, "normal"]);
				else this.playOrder([_fr, "up"]);
			}//if
		}//fn
		private function defaultSkin():void {
			trace("MouseSkin: Default Skin, assign frame label 'normal' or 'up' not found.");
			var _tmp:Shape=new Shape();
    	    _tmp.graphics.clear();
	        _tmp.graphics.beginFill(0xCD3333);
    	    _tmp.graphics.drawRect(0, 0, 10, 10);
	        _tmp.graphics.endFill();
			addChild(_tmp);
	    }//fn
	}//class
}//package